import 'package:json_annotation/json_annotation.dart';
part 'user_info_api.g.dart';

@JsonSerializable()
class ResponseUserInfoApi {
  final String userId;
  final String userName;
  final String? nickName;
  final String? email;
  final String? phone;
  final String? sex;
  final String? birthday;
  final String? userAvatars;

  ResponseUserInfoApi({
    required this.userId,
    required this.userName,
    this.nickName,
    this.email,
    this.phone,
    this.sex,
    this.birthday,
    this.userAvatars,
  });

  factory ResponseUserInfoApi.fromJson(Map<String, dynamic> json) =>
      _$ResponseUserInfoApiFromJson(json);

  Map<String, dynamic> toJson() => _$ResponseUserInfoApiToJson(this);

  ResponseUserInfoApi copyWith({
    String? userId,
    String? userName,
    String? nickName,
    String? email,
    String? phone,
    String? sex,
    String? birthday,
    String? userAvatars,
  }) {
    return ResponseUserInfoApi(
      userId: userId ?? this.userId,
      userName: userName ?? this.userName,
      nickName: nickName ?? this.nickName,
      email: email ?? this.email,
      phone: phone ?? this.phone,
      sex: sex ?? this.sex,
      birthday: birthday ?? this.birthday,
      userAvatars: userAvatars ?? this.userAvatars,
    );
  }
}
